package com.chengcang.api.modules.sys.controller;

import com.chengcang.api.modules.sys.service.SysAreaService;
import com.chengcang.api.modules.sys.vo.SysAreaVO;
import com.chengcang.common.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 区域表
 *
 * @author zhanli
 * @since 1.0.0 2023-01-10
 */
@RestController
@RequestMapping("busi/sysarea")
@Api(tags="区域管理")
public class SysAreaController {
    @Autowired
    private SysAreaService sysAreaService;

    @GetMapping("tree")
    @ApiOperation("省市区树结构")
    public Result<List<SysAreaVO>> tree(){
        List<SysAreaVO> data = sysAreaService.tree();

        return new Result<List<SysAreaVO>>().ok(data);
    }

}